package com.shoulei.designpattern.commandPattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName:Broker
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/4/14 17:20
 * @Verson:
 */
public class Broker {
    private List<Order> orderList = new ArrayList<Order>();

    public void takeOrder(Order order){
        orderList.add(order);
    }
    public void placeOrders(){
        for(Order order:orderList){
            order.execute();
        }
        orderList.clear();
    }
}
